// index.js
// 获取应用实例
const app = getApp()

Page({
  data: {
    swiperList:[],
    gridList:[]
    },

  onLoad:function(option){
    this.getSwiperList()
    this.getGridList()
  },

  getSwiperList(){
    wx.request({
      url: 'https://applet-base-api-t.itheima.net/slides',
      method:"get",
      success:(res)=>{
        // console.log(res)
        this.setData({
          swiperList:res.data
        })
      }
    })
  },
  getGridList(){
    wx.request({
      url: 'https://applet-base-api-t.itheima.net/categories',
      method:"get",
      success:(res)=>{
        // console.log(res)
        this.setData({
          gridList : res.data
        })
      }
    })
  },
})
